﻿@model ProductOverviewModel
@using Nop.Core.Domain.Orders
@using Nop.Web.Models.Catalog;
@{
    //prepare "Add to cart" AJAX link
    string addtocartlink = "";
    var shoppingCartTypeId = (int)ShoppingCartType.ShoppingCart;
    var quantity = 1;
    if (Model.ProductPrice.ForceRedirectionAfterAddingToCart)
    {
        addtocartlink = Url.RouteUrl("AddProductToCart-Catalog", new { productId = Model.Id, shoppingCartTypeId = shoppingCartTypeId, quantity = quantity, forceredirection = Model.ProductPrice.ForceRedirectionAfterAddingToCart });
    }
    else
    {
        addtocartlink = Url.RouteUrl("AddProductToCart-Catalog", new { productId = Model.Id, shoppingCartTypeId = shoppingCartTypeId, quantity = quantity, });
    }    
}
<li style="width: 192px;" class="ajax_block_product item" data-productid="@Model.Id">
    <a href="@Url.RouteUrl("Product", new { SeName = Model.SeName })" class="product_image" id="@Model.Id">
        <img alt="@Model.DefaultPictureModel.AlternateText" src="@Model.DefaultPictureModel.ImageUrl" title="@Model.DefaultPictureModel.Title" />
    </a>
    <h3 class="name_product">
        <a href="@Url.RouteUrl("Product", new { SeName = Model.SeName })">@Model.Name</a>
    </h3>
    <p class="price_container">
        @if (!String.IsNullOrEmpty(Model.ProductPrice.OldPrice))
        {
            <span class="price old-price">@Model.ProductPrice.OldPrice</span>
        }
        <span class="price actual-price">@Model.ProductPrice.Price</span>
    </p>
</li>
